## ortools CMake configuration file

set(@PACKAGE_PREFIX@_VERSION @PROJECT_VERSION@)

@PACKAGE_INIT@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")

include(CMakeFindDependencyMacro)
# Kitware CMake provide a FindZLIB.cmake module
if(NOT TARGET ZLIB::ZLIB)
  find_dependency(ZLIB REQUIRED)
endif()

if(NOT TARGET BZip2::BZip2)
  find_dependency(BZip2 REQUIRED)
endif()

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.6")
  set(CONFIG_FLAG CONFIG)
endif()

if(NOT TARGET absl::base)
  find_dependency(absl REQUIRED ${CONFIG_FLAG})
endif()

if(NOT TARGET protobuf::libprotobuf)
  # CMake provide a FindProtobuf module so we don't want to use the CONFIG_FLAG
  # also most distro still use the autotools based build for Protobuf.
  # ref: https://cmake.org/cmake/help/latest/module/FindProtobuf.html
  if(@BUILD_Protobuf@)
    find_dependency(Protobuf CONFIG REQUIRED)
  else()
    find_dependency(Protobuf REQUIRED)
  endif()
endif()

# re2 may not provide a CMake config files
if(NOT TARGET re2::re2)
  find_dependency(re2 REQUIRED)
endif()

if(@USE_COINOR@)
  # COIN-OR packages don't provide CMake config files
  if(NOT TARGET Coin::ClpSolver)
    find_dependency(Clp REQUIRED)
  endif()
  if(NOT TARGET Coin::CbcSolver)
    find_dependency(Cbc REQUIRED)
  endif()
endif()

if(@USE_GLPK@)
  if(NOT TARGET GLPK::GLPK)
    find_dependency(GLPK REQUIRED)
  endif()
endif()

if(@USE_HIGHS@)
  if(NOT TARGET highs::highs)
    find_dependency(highs REQUIRED ${CONFIG_FLAG})
  endif()
endif()

if(@USE_PDLP@)
  if(NOT TARGET Eigen3::Eigen)
    find_dependency(Eigen3 REQUIRED)
  endif()
endif()

if(@USE_SCIP@)
  if(NOT TARGET SCIP::libscip)
    find_dependency(SCIP REQUIRED)
  endif()
endif()

include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
